package shiyl.use.springboot.loadbalance.impl;

import org.hyperledger.fabric.sdk.Peer;
import shiyl.use.springboot.loadbalance.AbstractLoader;

/**
 * Fabric 中Peer节点进行适配，以支持负载均衡
 * @author shiyl
 */
public class PeerLoader extends AbstractLoader<Peer> {

    Peer peer ;

    public PeerLoader(Peer peer, int weight , boolean sticky){
        super(weight,sticky) ;
        this.peer = peer ;
    }

    @Override
    public String getUrl() {
        return this.peer.getUrl();
    }

    @Override
    public Peer getEndpoint() {
        return this.peer;
    }
}
